<template>
  <div class="searchCell">
    <van-cell>
      <template #icon>
        <div class="icon">
          <van-icon :name="icon" />
        </div>
      </template>
      <template #title>
        <div class="title" @click="goSeatch" v-html="title"></div>
      </template>
      <template #right-icon>
        <div class="right-icon" @click="delClick">
          <van-icon :name="right" />
        </div>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'searchCell',
  props: ['icon', 'title', 'right'],
  methods: {
    delClick () {
      this.$emit('delClick')
    },
    goSeatch () {
      this.$emit('goSearch', this.title)
    }
  }
}
</script>

<style lang="less" scoped>
.searchCell {
  .van-cell {
    padding-right: 0;
    padding-left: 0;
  }
  .van-icon {
    color: #ccc;
    font-weight: 600;
    font-size: 14px;
    line-height: 30px;
  }

  .icon {
    margin-right: 15px;
  }
  .title {
    font-size: 12px;
    overflow: hidden;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
</style>
